<template>
    <el-card style="margin-bottom: 10px;">
        <template #header>
            <div>
                <span>专业</span>
            </div>
        </template>
        <el-radio-group v-model="value" @click="$emit('specialtyCheck', value)">
            <template v-for="(specialty, index) in specialties" :key="index">
                <el-radio :label="specialty.id" size="small" border style="margin: 5px;">{{ specialty.name }}</el-radio>
            </template>
        </el-radio-group>
    </el-card>
</template>
<script>
import { findByCollege } from '@/api/specialty.js'
export default {
    props: {
        collegeId: {
            type: Number,
            default: 7
        }
    },
    data() {
        return {
            value: null,
            specialties: [],
        }
    },
    created() {
        findByCollege(this.collegeId).then(res => {
            this.specialties = res.data
        })
    }

}
</script>